<template>
  <footer class="footer">
    <span class="todo-count"
      >剩余<strong>{{ noMoule }}</strong></span
    >
    <ul class="filters">
      <li>
        <a
          :class="{ selected: key === 'all' }"
          href="javascript:;"
          @click="change('all')"
          >全部</a
        >
      </li>
      <li>
        <a
          :class="{ selected: key === 'no' }"
          href="javascript:;"
          @click="change('no')"
          >未完成</a
        >
      </li>
      <li>
        <a
          :class="{ selected: key === 'yes' }"
          href="javascript:;"
          @click="change('yes')"
          >已完成</a
        >
      </li>
    </ul>
    <button class="clear-completed" @click="removeWancheng">清除已完成</button>
  </footer>
</template>

<script>
import { mapGetters, mapMutations, mapState } from "vuex";
export default {
  
  computed: {
    ...mapGetters(["noMoule"]),
    ...mapState([ "key"])
  },
  methods: {
    ...mapMutations(["removeWancheng", "change"]),
  },
};
</script>

<style>

</style>
